package com.ares.core.vo;

import lombok.Data;

@Data
public class Result<T> extends BaseResponse {

    T data;

    boolean success;

    public Result(T t, String code, String description) {
        super.setCode(code);
        super.setDescription(description);
        data = t;
    }

    public Result(String code, String description) {
        super.setCode(code);
        super.setDescription(description);
    }

    public Result(T data) {
        this.data = data;
        super.setCode("200");
        super.setDescription("请求成功");
    }

    public static Result success() {
        return new Result((Object) null,"200", "请求成功");
    }

    public static <T> Result<T> success(T o) {
        Result<T> result = new Result<>(o, "200", "请求成功");
        return result;
    }

}
